package com.cino.org.domain;

import com.cino.basic.base.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;


/**
 * 实体类：部门
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    // 部门id

    // 部门编号
    private String sn;
    // 部门名称
    private String name;
    // 部门路径 - 没有用
    private String dirPath;
    //开启为1，关闭为0，默认开启
    private Integer state = 1;
    //部门经理id
    private Long manager_id;
    //上级部门id
    private Long parent_id;

    //保存部门经理的信息
    private Employee manager;
    //保存上级部门的信息
    private Department parent;
    //用于封装当前部门的子部门
    //部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();

}